﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ChartEdit
{
    public class SectionTreeNode : TreeNode
    {
        public Chart RootChart { get; set; }

        public EventsSectionEntry EventSection { get; set; }
    }

    public class RootTreeNode : TreeNode
    {
        public Chart RootChart { get; set; }

        public RootTreeNode( string text )
        {
            this.Text = text;
        }

        public InstrumentTreeNode FindOrCreateInstrument( string ins )
        {
            foreach ( InstrumentTreeNode diffTn in Nodes )
            {
                if ( diffTn.RealInstrument == ins )
                    return diffTn;
            }

            InstrumentTreeNode dtn = new InstrumentTreeNode();
            dtn.Instrument = ins;
            dtn.RealInstrument = ins;

            dtn.Text = Globals.Instance.ReplaceKey( ins );

            Nodes.Add( dtn );

            return dtn;
        }
    }

    public class InstrumentTreeNode : TreeNode
    {
        public Chart RootChart { get; set; }

        public string Instrument { get; set; }
        public string RealInstrument { get; set; }
    }

    public class TrackTreeNode : TreeNode
    {
        public Chart RootChart { get; set; }

        public NoteTrack Track { get; set; }
    }
}
